package gui;

import java.awt.event.MouseEvent;

import javax.swing.DefaultListModel;
import javax.swing.JList;

/**
 * 
 * @author Christian
 * 
 */
public class JHauptfensterList extends JList {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5033772990894830020L;
	
	/**
	 * 
	 */
	public JHauptfensterList() {

		super();
	}
	
	/**
	 * 
	 * @param model Model der Liste
	 */
	public JHauptfensterList(DefaultListModel model) {

		super(model);
	}
	
	/**
	 * @param evt Event
	 * @return Den Tooltip
	 */
	public String getToolTipText(MouseEvent evt) {

		int index = locationToIndex(evt.getPoint());
		if (getModel().getSize() == 0) {
			return "";
		}
		Object item = getModel().getElementAt(index);
		// Return the tool tip text
		return item.toString();
	}
}
